﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeFile="TestPage.aspx.cs" Inherits="TestPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <h2>
        Welcome to HTML Service</h2>
    <div id="dvAsyncResult">
    </div>
    <input type="button" name="btnGetHtml" value="Get Order" onclick="javascript:GetUserControlHtml()" />
    <script type="text/javascript">
        jQuery(document).ready(function () {

            //alert('jQuery is ready to serve you.')
            HTMLService.WebContent.GetTestHtml('jQuery with .Net', onSuccessSearchResult);
        });

        function onSuccessSearchResult(result) {
            
            var x = eval(result);
            jQuery('#dvAsyncResult').html(x.OutputHtml)
            alert(x.OutputHtml);
        }

        function GetUserControlHtml() {
            alert('Called me');
            HTMLService.WebContent.RenderOrderControl('Order', onSuccessSearchResult, onFailAlert);
        }

        function onFailAlert(result) {
            alert(result);
        }
    </script>
</asp:Content>
